package ads.remote;

import java.io.Serializable;
import java.net.URI;
import java.rmi.Remote;
import java.rmi.RemoteException;

import ads.exception.PlayingGameException;
import ads.util.GameInfo;

public interface ClientInterface extends Remote, Serializable {
	/**
	 * If the primary server fails the further communication is carried out by
	 * the new primary server, which calls the forwardConnection callback on
	 * each active client
	 * 
	 * @param uri
	 *            the new address of the primary server
	 */
	public void forwardConnection(URI uri) throws RemoteException;

	/**
	 * After the predefined number of players is achieved, the server calls the
	 * beginGame callback for each client, which joined the game.
	 * 
	 * @param game
	 * @throws RemoteException
	 */
	public void beginGame(GameInfo game) throws RemoteException;

	/**
	 * This method is called by the server after a client does relogin. The server gives
	 * the client updated game info.
	 * 
	 * @param game
	 */
	public void recovery(GameInfo game) throws RemoteException;

}
